package com.hj.chartdemo.chart;

import android.util.Log;

import com.github.mikephil.charting.charts.BarLineChartBase;
import com.github.mikephil.charting.components.AxisBase;
import com.github.mikephil.charting.formatter.IAxisValueFormatter;

import java.util.ArrayList;

/** Created by philipp on 02/06/16. */
public class BarAxisValueFormatter implements IAxisValueFormatter {

  private final BarLineChartBase<?> chart;
  private final ArrayList<String> xlab;

  public BarAxisValueFormatter(BarLineChartBase<?> chart,ArrayList<String> xlab) {
    this.chart = chart;
    this.xlab = xlab;
  }

  @Override
  public String getFormattedValue(float value, AxisBase axis) {
    Log.i("","getFormattedValue-------------"+value);
    String str = "";
    str = xlab.size() >= value ? xlab.get((int) value-1) : "";
    return str;
  }
}

